1. Field of the Invention
This invention relates to a method and apparatus for sharpening a grayscale image.
Often, images produced by scanners, particularly when scanning low quality documents such as microfilm or microfiche, are themselves of low quality. One of the most common problems is that the grayscale image lacks sharpness. Many inventors have attempted to correct or improve the image of scanned documents, whether from video transmissions, paper copies, film, negatives, microfilm, or microfiche. Two patents from such inventors, the launching pad for this invention, are described in U.S. Pat. Nos. 4,509,195 and 5,703,971, issued to Morton Nadler and Asimopoulos et al, respectively, both assigned to Image Processing Technologies of Blacksburg, Va.
In the former patent a scanner digitizes the signals representative of data values, e.g., intensity values, of the pixels of an image and inputs the signals into a sharpening circuit. After a comparison of each pixel with its immediate neighbors, a Pseudo-Laplacian binarization algorithm replaces the intensity value of the pixel with a logical zero (0), representing white, or a logical one (1), representing black. The disclosed process works fine for documents in which the image is supposed to be either black or white, such as printed text on a white paper. But, important details are lost, when it is applied to images which have gradations of gray, for example, photographs or X-rays.
The Asimpoulos et al patent shows how to modify the binarization parameters dynamically, based on local image characteristics, in particular how to dynamically adjust certain parameters on the fly, so to speak, as a function of the local contrast. While the binarization algorithm improves the quality of black and white images, it tends to lose importance, when applied to grayscale images. The current invention extends the binary version into the grayscale arena and inherits much of the advantages of its binary ancestor.
Grayscale images are characterized by the data value being represented by a more-than-one bit binary number, usually an eight bit binary number having a range corresponding to the numbers 0-255. Other ranges are known for digitizing the grayscale, most commonly based on binary numbers of 4 and 16 bits, comprising ranges of 0-15 and 0-65,535, respectively. The invention disclosed and claimed includes all means of representing the gray scale known in the art.
For this application and without loss of generality, 0 is considered black and 255 white with the intermediate values representing slowly changing gradations of gray between black and white. Obviously, the data value could also represent other measurable characteristics, such as transmittance, or variables found in colors, e.g., hue, saturation, and intensity.
2. Description of Related Art
Of the other patentees who have addressed the problem of grayscale enhancement, representative are U.S. Pat. No. 4,724,544 to Matsumoto, U.S. Pat. No. 5,271,064 to Dhawan et al, and U.S. Pat. No. 5,710,840 to Hideshima et al.
Matsumoto surveys the scanned pixel array with a square window having an odd number of pixels per side. The grayscale value of the center pixel is corrected in accord with the result of an algorithm which, essentially, multiplies the pixel information of the center pixel by the square of the size of the matrix array and subtracts therefrom the sum of the pixel information of all of the surrounding pixels in the window. Noise is suppressed by removing the lower order bits of the surrounding pixels prior to adding them together. The sharpness or smoothness of the image is said to be enhanced by the process.
Dhawan et al. examine an adaptive window surrounding the center pixel and use two masks, a smoothing mask and a sharpening mask, to determine whether the central pixel belongs to an edge and must be enhanced or to a uniform image area and must be smoothed. The determination of whether the central pixel belongs to an edge or not is performed by adding its differences from the surrounding pixels and comparing this value to a threshold. In order to determine if the central pixel belongs to a uniform area, a different pattern of gradient vectors is used. Multiple passes are required to complete the enhancement process.
In Hideshima et al. the surrounding pixels are subtracted from the central pixel and the differences summed. The adjustment in value of the central pixel is effected by multiplying that sum by a constant and adding the computed value to the original pixel.
The invention described here differs from the Dhawan et al. and the Hideshima et al. inventions in that only one window is used for comparisons, and the differences from surrounding pixels are individually compared to a threshold (sensitivity S) before being used to determine the enhancement factor. This difference is significant as it prevents small differences between the central pixel and surrounding pixels to accumulate and erroneously be interpreted as an edge.